using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SimilarPlayerShockState : EnemyState
{
    protected EnemySimilarPlayer enemySimilarPlayer;
    public SimilarPlayerShockState(Enemy _enmey, EnemyStateMachine _stateMachine, string _animBoolname, EnemySimilarPlayer _enemySimilarPlayer) : base(_enmey, _stateMachine, _animBoolname)
    {
        this.enemySimilarPlayer = _enemySimilarPlayer;
    }

    public override void Enter()
    {
        base.Enter();

        enemySimilarPlayer.SetVelocity(0, rb.velocity.y);

        statetimer = enemySimilarPlayer.shocktime;
    }

    public override void Exit()
    {
        base.Exit();

        enemySimilarPlayer.isShock = false;
        //enemySimilarPlayer.SetVelocity(enemySimilarPlayer.movespeed * enemySimilarPlayer.facingdir, rb.velocity.y);
    }

    public override void Update()
    {
        base.Update();

        if (statetimer < 0)
            enemySimilarPlayer.stateMachine.Changestate(enemySimilarPlayer.similarPlayerIdleState);
    }
}
